﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="Salary_Emp.aspx.cs" Inherits="Project_Udrinkwater.Empoyee_Management.Salary_Emp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
     <script type="text/javascript">
    // <![CDATA[
         function ShowSelectEmp() {
             PC_SelectDataEmpSalary.Show();
         }
        
    // ]]> 
    </script>
    <dx:ASPxRoundPanel ID="RPN_SalaryEmp" runat="server" Width="100%" 
         HeaderText="รายการเงินเดือน">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
     <dx:ASPxPanel ID="PN_ShoenameEmp" runat="server" Width="100%">
        <PanelCollection>
<dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
   <div>
        <dx:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server" 
        DataSourceID="SqlDataSource_Showsalary" Width="100%">
        <Fields>
            <dx:PivotGridField ID="fieldEmployeeID" AreaIndex="0" FieldName="Employee_ID">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldSalaryStartMonth" Area="RowArea" AreaIndex="0" 
                Caption="ประจำเดือน" FieldName="Salary_StartMonth" GroupInterval="DateMonth" 
                UnboundFieldName="fieldSalaryStartMonth">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldSalaryEndMonth" Area="ColumnArea" AreaIndex="0" 
                Caption="ประจำปี" FieldName="Salary_EndMonth" GroupInterval="DateYear" 
                UnboundFieldName="fieldSalaryEndMonth">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldOT" Area="DataArea" AreaIndex="1" 
                Caption="ทำงานล่วงเวลา(OT)" FieldName="OT">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldReduceAbsence" Area="DataArea" AreaIndex="3" 
                Caption="ขาดงานเกินกำหนด" FieldName="Reduce_Absence">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldReduceWithdraw" Area="DataArea" AreaIndex="4" 
                Caption="เบิกจ่ายล่วงหน้า" FieldName="Reduce_Withdraw">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldReduceOther" Area="DataArea" AreaIndex="5" 
                Caption="อื่นๆ" FieldName="Reduce_Other">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldCommission" Area="DataArea" AreaIndex="2" 
                Caption="คอมมิชชั่น" FieldName="Commission">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldSalary" Area="DataArea" AreaIndex="0" 
                Caption="เงินเดือน" FieldName="Salary">
            </dx:PivotGridField>
            <dx:PivotGridField ID="fieldTotalSalary" Area="DataArea" AreaIndex="6" 
                Caption="เงินเดือนสุทธิ" FieldName="TotalSalary">
            </dx:PivotGridField>
        </Fields>
        <OptionsView ShowDataHeaders="False" ShowFilterHeaders="False" />
<StylesPrint Cell-BackColor2="" Cell-GradientMode="Horizontal" FieldHeader-BackColor2="" FieldHeader-GradientMode="Horizontal" TotalCell-BackColor2="" TotalCell-GradientMode="Horizontal" GrandTotalCell-BackColor2="" GrandTotalCell-GradientMode="Horizontal" CustomTotalCell-BackColor2="" CustomTotalCell-GradientMode="Horizontal" FieldValue-BackColor2="" FieldValue-GradientMode="Horizontal" FieldValueTotal-BackColor2="" FieldValueTotal-GradientMode="Horizontal" FieldValueGrandTotal-BackColor2="" FieldValueGrandTotal-GradientMode="Horizontal" Lines-BackColor2="" Lines-GradientMode="Horizontal"></StylesPrint>
    </dx:ASPxPivotGrid></div>
            <asp:SqlDataSource ID="SqlDataSource_Showsalary" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT TB_Salary.Employee_ID, TB_Salary.Salary_StartMonth, TB_Salary.Salary_EndMonth, TB_Salary.OT, TB_Salary.Reduce_Absence, TB_Salary.Reduce_Withdraw, TB_Salary.Reduce_Other, TB_Salary.Commission, TB_Employee.Salary,((TB_Employee.Salary+TB_Salary.OT+TB_Salary.Commission)-(TB_Salary.Reduce_Absence+TB_Salary.Reduce_Withdraw+TB_Salary.Reduce_Other)) AS TotalSalary FROM TB_Salary INNER JOIN TB_Employee ON TB_Salary.Employee_ID = TB_Employee.Employee_ID WHERE (TB_Salary.Employee_ID = @Employee_ID)">
                <SelectParameters>
                    <asp:SessionParameter Name="Employee_ID" SessionField="Emp_ID" />
                </SelectParameters>
    </asp:SqlDataSource>
            </dx:PanelContent>
</PanelCollection>
    </dx:ASPxPanel>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
    </asp:Content>
